package com.drm.netschool.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.drm.netschool.entity.DrmUserSinfoLog;
import com.drm.netschool.entity.DrmUserSinfoLogExample;

public interface DrmUserSinfoLogMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo_log
     *
     * @mbggenerated Thu Apr 09 23:05:42 CST 2015
     */
    int countByExample(DrmUserSinfoLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo_log
     *
     * @mbggenerated Thu Apr 09 23:05:42 CST 2015
     */
    int deleteByExample(DrmUserSinfoLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo_log
     *
     * @mbggenerated Thu Apr 09 23:05:42 CST 2015
     */
    @Delete({
        "delete from drm_user_sinfo_log",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo_log
     *
     * @mbggenerated Thu Apr 09 23:05:42 CST 2015
     */
    @Insert({
        "insert into drm_user_sinfo_log (id, user_id, ",
        "user_gread, user_integral, ",
        "user_credit, user_learncredit, ",
        "lastupdate_dt, create_dt)",
        "values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, ",
        "#{userGread,jdbcType=VARCHAR}, #{userIntegral,jdbcType=INTEGER}, ",
        "#{userCredit,jdbcType=INTEGER}, #{userLearncredit,jdbcType=INTEGER}, ",
        "#{lastupdateDt,jdbcType=TIMESTAMP}, #{createDt,jdbcType=TIMESTAMP})"
    })
    int insert(DrmUserSinfoLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo_log
     *
     * @mbggenerated Thu Apr 09 23:05:42 CST 2015
     */
    int insertSelective(DrmUserSinfoLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo_log
     *
     * @mbggenerated Thu Apr 09 23:05:42 CST 2015
     */
    List<DrmUserSinfoLog> selectByExample(DrmUserSinfoLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo_log
     *
     * @mbggenerated Thu Apr 09 23:05:42 CST 2015
     */
    @Select({
        "select",
        "id, user_id, user_gread, user_integral, user_credit, user_learncredit, lastupdate_dt, ",
        "create_dt",
        "from drm_user_sinfo_log",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @ResultMap("BaseResultMap")
    DrmUserSinfoLog selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo_log
     *
     * @mbggenerated Thu Apr 09 23:05:42 CST 2015
     */
    int updateByExampleSelective(@Param("record") DrmUserSinfoLog record, @Param("example") DrmUserSinfoLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo_log
     *
     * @mbggenerated Thu Apr 09 23:05:42 CST 2015
     */
    int updateByExample(@Param("record") DrmUserSinfoLog record, @Param("example") DrmUserSinfoLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo_log
     *
     * @mbggenerated Thu Apr 09 23:05:42 CST 2015
     */
    int updateByPrimaryKeySelective(DrmUserSinfoLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table drm_user_sinfo_log
     *
     * @mbggenerated Thu Apr 09 23:05:42 CST 2015
     */
    @Update({
        "update drm_user_sinfo_log",
        "set user_id = #{userId,jdbcType=BIGINT},",
          "user_gread = #{userGread,jdbcType=VARCHAR},",
          "user_integral = #{userIntegral,jdbcType=INTEGER},",
          "user_credit = #{userCredit,jdbcType=INTEGER},",
          "user_learncredit = #{userLearncredit,jdbcType=INTEGER},",
          "lastupdate_dt = #{lastupdateDt,jdbcType=TIMESTAMP},",
          "create_dt = #{createDt,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(DrmUserSinfoLog record);
}